package com.sojson.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.sojson.base.impl.BaseDaoImpl;
import com.sojson.dao.BrokerageDao;
import com.sojson.entity.po.Brokerage;

/**
 * 分佣信息Dao实现类(目的:把分页插件从Service层分离,这样就不用每次调Dao接口都要分页)
 * 
 * @author liu
 * @date 2021-06-29
 */
@Repository
public class BrokerageDaoImpl extends BaseDaoImpl<BrokerageDao, Brokerage> implements BrokerageDao {

    @Resource
    private BrokerageDao brokerageDao;

    /**
     * 单条插入
     * 
     * @param brokerage
     * @return
     */
    @Override
    public int insert(Brokerage brokerage) {
        return brokerageDao.insert(brokerage);
    }

    /**
     * 批量插入
     * 
     * @param brokerage
     * @return
     */
    @Override
    public int insertList(List<Brokerage> brokerages) {
        return brokerageDao.insertList(brokerages);
    }

    /**
     * 通过对象批量删除(物理删除)
     * 
     * @param brokerage
     * @return
     */
    @Override
    public int deleteByDto(Brokerage brokerage) {
        return brokerageDao.deleteByDto(brokerage);
    }

    /**
     * 统计全部数量
     * 
     * @return
     */
    @Override
    public int countAll() {
        return brokerageDao.countAll();
    }

    /**
     * 查询所有
     * 
     * @return
     */
    @Override
    public List<Brokerage> listAll() {
        return brokerageDao.listAll();
    }

    /**
     * 根据对象统计数量
     * 
     * @param brokerage
     * @return
     */
    @Override
    public int countByDto(Brokerage brokerage) {
        return brokerageDao.countByDto(brokerage);
    }

    /**
     * 根据对象查询
     * 
     * @param brokerage
     * @return
     */
    @Override
    public List<Brokerage> listByDto(Brokerage brokerage) {
        startPageDefaultSort(brokerage);
        return brokerageDao.listByDto(brokerage);
    }

    /**
     * 通过id删除(物理删除)
     * 
     * @param id
     * @return
     */
    @Override
    public int deleteById(Integer id) {
        return brokerageDao.deleteById(id);
    }

    /**
     * 通过id数组删除(物理删除)
     * 
     * @param ids
     * @return
     */
    @Override
    public int deleteByIds(Integer[] ids) {
        return brokerageDao.deleteByIds(ids);
    }

    /**
     * 通过id更新(全部更新)
     * 
     * @param brokerage
     * @return
     */
    @Override
    public int updateAllById(Brokerage brokerage) {
        return brokerageDao.updateAllById(brokerage);
    }

    /**
     * 通过id列表更新(全部更新)(更新内容相同)
     * 
     * @param brokerage
     * @return
     */
    @Override
    public int updateAllByIdList(Brokerage brokerage) {
        return brokerageDao.updateAllByIdList(brokerage);
    }

    /**
     * 通过id列表更新(全部更新)(更新内容不相同)
     * 
     * @param brokerages
     * @return
     */
    @Override
    public int updateDtoListAllById(List<Brokerage> brokerages) {
        return brokerageDao.updateDtoListAllById(brokerages);
    }

    /**
     * 通过id更新(局部更新)
     * 
     * @param brokerage
     * @return
     */
    @Override
    public int updateById(Brokerage brokerage) {
        return brokerageDao.updateById(brokerage);
    }

    /**
     * 通过id列表更新(局部更新)(更新内容相同)
     * 
     * @param brokerage
     * @return
     */
    @Override
    public int updateByIdList(Brokerage brokerage) {
        return brokerageDao.updateByIdList(brokerage);
    }

    /**
     * 通过id列表更新(局部更新)(更新内容不相同)
     * 
     * @param brokerages
     * @return
     */
    @Override
    public int updateDtoListById(List<Brokerage> brokerages) {
        return brokerageDao.updateDtoListById(brokerages);
    }

    /**
     * 通过id查询
     * 
     * @param id
     * @return
     */
    @Override
    public Brokerage findById(Integer id) {
        return brokerageDao.findById(id);
    }

    /**
     * 通过id数组查询
     * 
     * @param ids
     * @return
     */
    @Override
    public List<Brokerage> findByIds(Integer[] ids) {
        return brokerageDao.findByIds(ids);
    }

    /**
     * 通过对象查询id列表
     * 
     * @param brokerage
     * @return
     */
    @Override
    public List<Integer> findIdByDto(Brokerage brokerage) {
        startPage(brokerage);
        return brokerageDao.findIdByDto(brokerage);
    }

    /**
     * 清空数据(物理清空)
     */
    @Override
    public int clear() {
        return brokerageDao.clear();
    }

}